package br.gov.jfrj.siga.util;

import java.util.ResourceBundle;

public enum ConfigAppBundle {

	POLITICA_CRL("politica.crl"), POLITICA_OCSP("politica.ocsp"), POLITICA_SIGNER(
			"politica.signer"), POLITICA_URL("politica.url"), ACT_CERT(
			"act.cert"), ACT_URL("act.url"), CACHE_LCR("cache.LCR"), ORGANIZATION_NAME(
			"ORGANIZATION_NAME"), PA_AD_RB("2.16.76.1.7.1.1.1"), PA_AD_RT(
			"2.16.76.1.7.1.2.1"), PA_AD_RV("2.16.76.1.7.1.3.1"), PA_AD_RC(
			"2.16.76.1.7.1.4.1"), PA_AD_RA("2.16.76.1.7.1.5.1"), ORGANIZATION_LICENSE(
			"ORGANIZATION_LICENSE"), CADEIA_CONFIANCA("cadeia.confianca"), PROXY_ENDERECO(
			"proxy.endereco"), PROXY_PORTA("proxy.porta"), PROXY_USER(
			"proxy.user"), PROXY_SENHA("proxy.senha");

	public String key;

	ConfigAppBundle(String key) {
		this.key = key;
	}

	public String getProperty() {
		return ResourceBundle.getBundle("br/gov/jfrj/siga/util/cfgApp").getString(
				this.key);
	}

	public static String getPolicyName(String key) {
		for (ConfigAppBundle configIterator : values()) {
			if (key != null && configIterator != null
					&& configIterator.key != null
					&& key.equalsIgnoreCase(configIterator.key)) {
				return configIterator.name();
			}
		}
		return "";
	}
}
